package com.code.entity.iterator;

import java.util.LinkedList;
import java.util.List;

/**
 * 具体聚合
 */
public class Pom<E> implements PomNode<E> {
    private List<E> list = new LinkedList<>();

    @Override
    public void add(E e) {
        list.add(e);
    }

    @Override
    public NodeIterator<E> iterator() {
        return new Node<>(list);
    }
}
